import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '付款账号',
    align: "center",
    ellipsis: false,
    width: 200,
    dataIndex: 'recAccount'
  },
  {
    title: '付款户名',
    width: 250,
    ellipsis: false,
    align: "center",
    dataIndex: 'recAccountName'
  },
  {
    title: '交易时间',
    align: "center",
    dataIndex: 'transferDate'
  },
  {
    title: '借方金额',
    align: "center",
    dataIndex: 'debitAmount'
  },
  {
    title: '贷方金额',
    align: "center",
    dataIndex: 'loanamount'
  },
  {
    title: '匹配状态',
    align: "center",
    dataIndex: 'matchState_dictText'
  },
  {
    title: '打款备注',
    align: "center",
    dataIndex: 'payRem'
  },
  {
    title: '业务类型',
    align: "center",
    dataIndex: 'matchBusType_dictText'
  },
  {
    title: '订单编号',
    align: "center",
    dataIndex: 'matchBusSerialNo'
  },
  {
    title: '对手方银行名',
    align: "center",
    dataIndex: 'partyBankName'
  },
  {
    title: '修正后的摘要码',
    align: "center",
    dataIndex: 'reviseSummaryNo'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "付款账号",
    field: 'recAccount',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "付款户名",
    field: 'recAccountName',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "借方金额",
    field: "debitAmount",
    component: 'Input', //TODO 范围查询
    colProps: {span: 6},
  },
  {
    label: "摘要码",
    field: 'summaryNo',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "摘要",
    field: 'summary',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "匹配状态",
    field: 'matchState',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "ZJPPZT"
    },
    colProps: {span: 6},
  },
  {
    label: "业务类型",
    field: 'matchBusType',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "PPYWLX"
    },
    colProps: {span: 6},
  },
  {
    label: "业务流水号",
    field: 'matchBusSerialNo',
    component: 'Input',
    colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '付款账号',
    field: 'recAccount',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入付款账号!'},
             ];
    },
    dynamicDisabled: true
  },
  {
    label: '付款户名',
    field: 'recAccountName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入付款户名!'},
             ];
    },
    dynamicDisabled: true
  },
  {
    label: '交易时间',
    field: 'transferDate',
    component: 'Input',
    dynamicDisabled: true
  },
  {
    label: '币种汉字',
    field: 'currencyTypeHz',
    component: 'Input',
    dynamicDisabled: true
  },
  {
    label: '借方金额',
    field: 'debitAmount',
    component: 'Input',
    dynamicDisabled: true
  },
  {
    label: '贷方金额',
    field: 'loanamount',
    component: 'InputNumber',
    dynamicDisabled: true
  },
  {
    label: '摘要码',
    field: 'summaryNo',
    component: 'Input',
    dynamicDisabled: true
  },
  {
    label: '摘要',
    field: 'summary',
    component: 'Input',
    dynamicDisabled: true
  },
  {
    label: '余额',
    field: 'balance',
    component: 'InputNumber',
    dynamicDisabled: true
  },
  {
    label: '币种',
    field: 'currencyType',
    component: 'Input',
    dynamicDisabled: true
  },
  {
    label: '凭证号',
    field: 'vouchersNo',
    component: 'Input',
    dynamicDisabled: true
  },
  {
    label: '凭证种类',
    field: 'vouchType',
    component: 'Input',
    dynamicDisabled: true
  },
  {
    label: '手续费',
    field: 'tranFee',
    component: 'InputNumber',
    dynamicDisabled: true
  },
  {
    label: '明细序列号',
    field: 'serialNo',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入明细序列号!'},
             ];
    },
    dynamicDisabled: true
  },
  {
    label: '匹配状态',
    field: 'matchState',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "ZJPPZT"
    },
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入匹配状态!'},
             ];
    },
    dynamicDisabled: true
  },
  {
    label: '业务类型',
    field: 'matchBusType',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "PPYWLX"
    },
    dynamicDisabled: true
  },
  {
    label: '业务流水号',
    field: 'matchBusSerialNo',
    component: 'Input',
    dynamicDisabled: true
  },
  {
    label: '对手方银行名',
    field: 'partyBankName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入对手方银行名!'},
             ];
    },
    dynamicDisabled: true
  },
  {
    label: '修正后的摘要码',
    field: 'reviseSummaryNo',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
